package cn.itcast.config;

import cn.itcast.client.fallback.UserClientFallbackFactory;
import feign.Logger;
import org.springframework.context.annotation.Bean;


/**
 * @author Xiao
 * @date 2021/10/15
 */
public class DefaultFeignConfigration {
    /**
     * 自定义Feign日志级别
     * @return
     */
    @Bean
    public Logger.Level feignLogLevel() {
        return Logger.Level.BASIC;  //日志级别为BASIC
    }

    /**
     * 注入sentinel的FallbackFactory
     */
    @Bean
    public UserClientFallbackFactory fallbackFactory() {
        return new UserClientFallbackFactory();
    }
}
